package com.team.bus.module.organization.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.zjframework.traceframe.common.dao.util.StringUtil;
import org.zjframework.traceframe.common.service.impl.CommonServiceImpl;

import com.team.bus.module.organization.dao.IOrganizationDao;
import com.team.bus.module.organization.service.IOrganizationService;

import java.util.List;
import java.util.Map;


@Service("organizationService")
public class OrganizationServiceImpl extends CommonServiceImpl implements IOrganizationService {

	
	private IOrganizationDao organizationDao;

	public IOrganizationDao getOrganizationDao() {
		return organizationDao;
	}

	@Resource
	public void setOrganizationDao(IOrganizationDao organizationDao) {
		this.organizationDao = organizationDao;
	}



	@Override
	public String getozpid(String oid) {

		String sqloz="SELECT pp.TEXT FROM torganization p,torganization pp WHERE p.pid=p.id AND p.id='"+oid+"';";
		List<Map<String,Object>> listdept=organizationDao.findForJdbc(sqloz);
		String nowtext="";
		String type="yg";
		if(listdept.size()>0){
			nowtext= StringUtil.isNotEmpty(listdept.get(0).get("TEXT"))?listdept.get(0).get("TEXT").toString():"";
		}
		if(nowtext.contains("路政"))type="lz";
		if(oid.equals("402880e7558ae22301558ae2d7bd0000"))type="lz";

		return type;
	}

}



